<?php
declare (strict_types = 1);

namespace app\shop\controller;

use think\annotation\Route;
use think\annotation\route\Group;
use think\annotation\route\Middleware;
use app\common\service\ChannelBusinessService\BusinessService;
use app\BaseShopController;
use think\Request;

/**
 * @Group("Business")
 * @Middleware({shopMiddileware::class})
 */
class Business extends BaseShopController
{
    /**
     * 获取渠道下拉菜单列表分页
     * @Route("getListBySelect",method="GET")
     * @return string
     */
    public function getListBySelect() {
        $result = callApi(BusinessService::class, 'channelBusinessSelectList',$this->_all_data);
        return apiResponse($result);
    }
    
    /**
     * 获取渠道列表分页(招商页面)
     * @Route("getListByPage",method="GET")
     * @return string
     */
    public function getListByPage() {
        $result = callApi(BusinessService::class, 'channelBusinessList',$this->_all_data);
        return apiResponse($result);
    }
    
    /**
     * 刷新渠道二维码
     * @Route("makeChannelBusinessQrcode/:cb_id",method="GET")
     * @return string
     */
    public function makeChannelBusinessQrcode($cb_id) {
        $param=[
            'cid'=> $this->_master_user['cid'],
            'cb_id'=>$cb_id
        ];
        $result = callApi(BusinessService::class, 'makeChannelBusinessQrcode',$param);
        return apiResponse($result);
    }
    
    
}
